package{
	import com.core.Application;
	import com.struct.Container;
	import com.test.AngleBounce;
	import com.test.AngleBounceOpt;
	import com.test.MultiAngleBounce;
	import com.test.Rotate1;
	import com.test.Rotate2;
	import com.test.Rotate3;
	import com.test2.Billiard1;
	import com.test2.Billiard2;
	import com.test2.Billiard3;
	import com.test2.Billiard4;
	import com.test2.MultiBilliard;
	
	import config.Configuration;
	
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	
	[SWF(width = 580, height = 580)]
	public class Main extends Sprite{
		public static var c:Configuration;
		private var game:Game;
		public function Main(){
			SSA.initialization();
			c = new Configuration();
			game = new Game();
			initLayer();//初始化层次结构
			initConfig();
		}
		private function initLayer():void {
			var application:Application = SSA.application;
			addChild(application);
			stage.align = flash.display.StageAlign.TOP_LEFT;
			stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
			stage.showDefaultContextMenu = false;
			stage.addEventListener(Event.RESIZE, resizeEvent);
			SSA.application.resizeSize(stage.stageWidth, stage.stageHeight);
		}
		private function resizeEvent(e:Event = null):void {
			if(stage.stageWidth != 0 || stage.stageHeight != 0){
				SSA.application.resizeSize(stage.stageWidth, stage.stageHeight);
			}
		}
		private function initConfig():void{//初始化配置文件	各种配置路径
			initGame();
		}
		private function initGame():void{
			game.startup(this);
		}
	}
}